﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace SelectEnv
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Count() > 0)
            {
                try
                {
                    if (args[0].ToUpper().Equals("MAIN"))
                    {
                        File.Delete("WCFHosting.Console.exe.config");
                        File.Copy(@"_SelectEnv\MAIN_WCFHosting.Console.exe.config", "WCFHosting.Console.exe.config");
                    }
                    else if (args[0].ToUpper().Equals("DEV"))
                    {
                        File.Delete("WCFHosting.Console.exe.config");
                        File.Copy(@"_SelectEnv\DEV_WCFHosting.Console.exe.config", "WCFHosting.Console.exe.config");

                    }
                    else if (args[0].ToUpper().Equals("PROD"))
                    {
                        File.Delete("WCFHosting.Console.exe.config");
                        File.Copy(@"_SelectEnv\PROD_WCFHosting.Console.exe.config", "WCFHosting.Console.exe.config");
                    }
                }
                catch (Exception e)
                {
                    throw e;
                }
            }
        }
    }
}
